<script type="text/javascript">
$(function () {
	$.ajaxSetup({cache: false});
	$('#editConfigForm').find("input:checkbox, input:radio").not('input.ibtn').uniform();
});

function saveConfig() {
	sys_loading();
	var parm = $('#editConfigForm').serialize();
	var url = create_url('config-save');
	$.ajax({type:'POST', url:url, data:parm,
		success: function(result) {
			sys_loading_close();
			if (result == 'success')
				sys_msg('操作成功!');
			else
				sys_warning('操作失败!');
		}
	});
}

function loadCache() {
	var url = create_url('config-cache');
	sys_loading();
	$.ajax({type:'POST', url:url, 
		success: function(result) {
			sys_submiting_close();
			if (result == 'success') {
				sys_msg('加载成功!');
			} else {
				sys_warning('错误提示', '加载失败！');
			}
		}
	});
}

function loadIndexCache() {
	var url = create_url('config-loadIndexCache');
	sys_loading();
	$.ajax({type:'POST', url:url, 
		success: function(result) {
			sys_submiting_close();
			if (result == 'success') {
				sys_msg('加载成功!');
			} else {
				sys_warning('错误提示', '加载失败！');
			}
		}
	});
}
</script>

<#import "/freemarker/modeltype.ftl" as mt>

<div class="widget" style="width:650px;float:left;">
	<div class="widget-header">
		<h3 class="title"><i class="fontello-icon-th-list-1"></i> 系统配置</h3>
	</div>
	<div class="widget-content">
		<form id="editConfigForm">
			<table class="table boo-table table-content">
				<tr>
					<td class="table-left" style="width:140px;">项目地址</td>
					<td><input class="form-control"  type="text" name="contextPath" value="${(contextPath)!''}" style="width:100px;" /></td>
				</tr>
				<tr>
					<td class="table-left">每页显示几条记录</td>
					<td><input class="form-control"  type="text" name="pageSize" value="${(pageSize)!''}" style="width:50px;" /></td>
				</tr>
				<tr>
					<td class="table-left">是否记录操作日志</td>
					<td><@mt.YesOrNo value=((recordLog)!false) r=true name='recordLog' d=false mc=false/></td>
				</tr>
				<tr>
					<td class="table-left">项目路径</td>
					<td><input class="form-control"  type="text" name="projectPath" value="${(projectPath)!''}" style="width:400px;" /></td>
				</tr>
				<tr>
					<td class="table-left">公告的缓存数量</td>
					<td><input class="form-control"  type="text" name="cacheNoticeTotal" value="${(cacheNoticeTotal)!''}" style="width:400px;" /></td>
				</tr>
				<tr>
					<td colspan="2" style="text-align: center;">
						<a href="#" class="btn btn-info" onclick="javascript: saveConfig(); return false;">
							<i class="fontello-icon-floppy"></i>&nbsp;保&nbsp;&nbsp;存
						</a>
					</td>
				</tr>
			</table>
		</form>
	</div>
</div>







<div class="widget" style="width:300px;float:left;">
	<div class="widget-header">
		<h3 class="title"><i class="fontello-icon-th-list-1"></i> 信息加载</h3>
	</div>
	<div class="widget-content">
		<li><a class="btn btn-well btn-glyph" href="javascript:;" onclick="javascript:loadCache();" style="width:80px"><i class="fontello-icon-floppy f30"></i><span class="block">加载缓存信息</span></a></li>
		<li><a class="btn btn-well btn-glyph" href="javascript:;" onclick="javascript:loadIndexCache();" style="width:80px"><i class="fontello-icon-right-hand f30"></i><span class="block">加载静态首页</span></a></li>
	</div>
</div>



